<!--
 * @Author: 梁志恒 1067531094@qq.com
 * @Date: 2022-10-08 16:50:18
 * @LastEditors: 梁志恒 1067531094@qq.com
 * @LastEditTime: 2022-10-08 19:51:44
 * @FilePath: \作业需求\demo01.html
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        // class B { }
        // let b = new B()
        // console.log(b.constructor)
        let arr = [1, 2, 3, 0, 0, 0, 0];
        class S {
            set(arr) {
                this.arr = arr
                let _empty = []
                let delete_val = 0
                for (let i = 0; i < arr.length; i++) {
                    if (arr[i] != delete_val) {
                        _empty.push(arr[i])
                    }
                }
                return _empty
            }
        }
        let s = new S()
        let a = s.set(arr)
        console.log(a)
    </script>
</body>

</html>